import { Notification } from 'element-ui';
import Service from './service';

/**
 * 实体服务基类
 *
 * @export
 * @class EntityServie
 */
export default class EntityServie extends Service {

    /**
     * Creates an instance of EntityServie.
     * 
     * @param {*} [opts={}]
     * @memberof EntityServie
     */
    constructor(opts: any = {}) {
        super(opts);
    }

    /**
     * Save
     *
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof EntityServie
     */
    public async save(data: any = {}, isloading?: boolean): Promise<any> {
        Notification.warning('预置实体行为 save 未实现');
        return;
    }

    /**
     * Get
     *
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof EntityServie
     */
    public async get(data: any = {}, isloading?: boolean): Promise<any> {
        Notification.warning('预置实体行为 get 未实现');
        return;
    }

    /**
     * Update
     *
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof EntityServie
     */
    public async update(data: any = {}, isloading?: boolean): Promise<any> {
        Notification.warning('预置实体行为 update 未实现');
        return;
    }

    /**
     * Create
     *
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof EntityServie
     */
    public async create(data: any = {}, isloading?: boolean): Promise<any> {
        Notification.warning('预置实体行为 create 未实现');
        return;
    }

    /**
     * Remove
     *
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof EntityServie
     */
    public async remove(data: any = {}, isloading?: boolean): Promise<any> {
        Notification.warning('预置实体行为 remove 未实现');
        return;
    }

    /**
     * CheckKey
     *
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof EntityServie
     */
    public async checkkey(data: any = {}, isloading?: boolean): Promise<any> {
        Notification.warning('预置实体行为 checkkey 未实现');
        return;
    }

    /**
     * GetDraft
     *
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof EntityServie
     */
    public async getdraft(data: any = {}, isloading?: boolean): Promise<any> {
        Notification.warning('预置实体行为 getdraft 未实现');
        return;
    }
}